package com.bandit.service.impl;

import com.bandit.dao.CommentDao;
import com.bandit.pojo.Comment;
import com.bandit.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {

    @Autowired
    private CommentDao commentDao;

    @Override
    public void addComment(Comment comment) {
        commentDao.addComment(comment);
    }

    @Override
    public int getLastCommentId() {
        return commentDao.getLastCommentId();
    }

    @Override
    public List<Comment> getCommentListByBlogID(int blog_id) {
        return commentDao.getCommentListByBlogID(blog_id);
    }

    @Override
    public Comment getCommentByID(int id) {
        return commentDao.getCommentByID(id);
    }

    @Override
    public void updateCommentHit(int commentHit,int id) {
        commentDao.updateCommentHit(commentHit,id);
    }

    @Override
    public List<Comment> getAllComment() {
        return commentDao.getAllComment();
    }

    @Override
    public void deleteCommentByID(int id) {
        commentDao.deleteCommentByID(id);
    }
}
